package com.company.linkedlist;

import com.company.linkedlist.model.DoubleLinkedList;
import com.company.linkedlist.model.Node;

/**
 * @author shenhan
 * @create 2020/1/28 13:18
 * @description
 */
public class DoubleLinkedListDemo {
    public static void main(String[] args) {
        final Node node1 = new Node(1, "宋江", "及时雨");
        final Node node2 = new Node(2, "卢俊义", "玉麒麟");
        final Node node3 = new Node(3, "吴用", "智多星");
        final Node node4 = new Node(4, "林聪", "豹子头");
        DoubleLinkedList doubleLinkedList = new DoubleLinkedList();
        doubleLinkedList.add(node1);
        doubleLinkedList.add(node2);
        doubleLinkedList.add(node3);
        doubleLinkedList.add(node4);
        doubleLinkedList.list();
        Node node = new Node(4, "母夜叉", "母夜叉");
        doubleLinkedList.update(node);
        System.out.println("-------------------");
        doubleLinkedList.list();
        doubleLinkedList.delete(4);
        System.out.println("-------------------");
        doubleLinkedList.list();
    }
}
